package com.fhz.day004.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.fhz.day004.R
import com.fhz.day004.entity.Data
import kotlinx.android.synthetic.main.rv_layout.view.*

/**
 * 时间:2021/10/15
 * @author msfeng
 * 简述: TODO
 */
class FoodAdapter(layoutId:Int,data:MutableList<Data>) : BaseQuickAdapter<Data,BaseViewHolder>(layoutId,data){

    override fun convert(helper: BaseViewHolder, item: Data) {
       helper.setText(R.id.rv_title,item.title)
        Glide.with(mContext).load(item.pic).into(helper.getView(R.id.rv_img))
        helper.addOnClickListener(R.id.rv_img)
        helper.addOnClickListener(R.id.rv_title)
    }
}